package com.raymond.controller;

import com.raymond.service.EmployeeService;
import com.raymond.entity.employee.EmployeeEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * desc-
 *
 * @author houmenghe
 * @date 2025/04/16 18:40
 **/
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private EmployeeService employeeService;

    @GetMapping("/hello")
    public String hello() {
        return "Hello World!";
    }

    @GetMapping("/get/{id}")
    public EmployeeEntity get(@PathVariable("id") Long id) {
        return employeeService.get(id);
    }


    @GetMapping("/save")
    public void save() {
        employeeService.saveRandom();
    }
}
